home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2004-02-26 | 43.5 KB | 1,807 lines
#!/bin/sh # # Copyright (c) 2003-2004 Linuxant inc. # # NOTE: The use and distribution of this software is governed by the terms in # the file LICENSE, which is included in the package. You must read this and # agree to these terms before using or distributing this software. # # This script handles all aspects of installing and configuring the # Linuxant DriverLoader for Wireless LAN devices driver under Linux. # # It tries to be as distribution-neutral as possible. ask_yesno() { $automode && return $2 while true; do echo -n "$1" read answer case "${answer}" in [yY] | [yY][eE][sS]) return 0 ;; [nN] | [nN][oO]) return 1 ;; "") return $2 ;; *) echo "Enter 'yes' or 'no'" ;; esac done } # Convert a key from display to internal format # The md5sum is used for input verification. disptokey() { k="`echo \"$1\" | tr '[a-z]' '[A-Z]' | sed -e 's/^$/none/' -e 's/none/00000000/' | tr -d -c '[0-9A-F\012]'`" case $k in 00000000) echo "$k" ;; ????????????) key="`echo \"$k\" | cut -c1-8`" if [ "`echo \"${key}\" | md5sum | cut -c1-4 | tr '[a-f]' '[A-F]'`" = "`echo \"$k\" | cut -c9-12`" ]; then echo "${key}" else echo "checksum error" fi ;; *) echo "format error" ;; esac } # Convert a key from internal to display format # The md5sum is generated for input verification. keytodisp() { key="$1" if [ -z "${key}" -o "${key}" = "00000000" ]; then echo none return 0 fi sum="`echo \"${key}\" | md5sum | cut -c1-4 | tr '[a-f]' '[A-F]'`" echo "${key}${sum}" | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\)$/\1-\2-\3-\4-\5-\6/' } ask_license() { while true; do if [ -n "${setlicense}" ]; then answer="`disptokey \"${setlicense}\"`" elif ${automode}; then answer="${license}" else echo "" echo "License keys can be obtained from http://www.linuxant.com/" echo "" echo "The MAC address for interface ${parm_netifname[${netif}]} is: ${parm_hwid[${netif}]}" echo "" echo -n "Please enter license key [`keytodisp \"$license\"`]: " read answer case "${answer}" in "" | *"[ ]"*) answer="${license}" ;; *) answer="`disptokey \"${answer}\"`" ;; esac fi case "${answer}" in [0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F][0-9A-F]) license="${answer}" return 0 ;; *) echo "" echo "ERROR: Invalid license key: \"${answer}\"." if ${automode}; then return 1 fi setlicense="" ;; esac done } ask_licowner() { while true; do if [ -n "${setlicowner}" ]; then answer="${setlicowner}" elif ${automode}; then if [ -z "${licowner}" ]; then return 1 fi answer="${licowner}" else echo "" echo "Note: we respect user privacy. Email addresses are not communicated" echo "nor used for any purpose other than to manage licenses!" echo "" echo -n "Please enter your email address [$licowner]: " read answer case "${answer}" in "" | *"[ ]"*) answer="${licowner}" ;; *) answer="`echo \"${answer}\" | tr '[A-Z]' '[a-z]' | tr -d '[ <>\012]'`" ;; esac fi case "${answer}" in ?*@?*.?*) licowner="${answer}" return 0 ;; *) if ! ${automode} || [ "${answer}" != "unknown" ]; then echo "" echo "ERROR: Invalid email address format: \"${answer}\"." fi if ${automode}; then return 1 fi setlicowner="" ;; esac done } needfullversion() { echo "" echo "This is a time-limited demonstration license." echo "A license without this limitation can be obtained from http://www.linuxant.com/" } configure_license() { if ${isfreeversion}; then needfullversion return 1 fi licowner="${setlicowner}" if [ -z "${licowner}" -a -n "${parm_licowner[${netif}]}" ]; then licowner="${parm_licowner[${netif}]}" if [ "${licowner}" = "unknown" ]; then licowner="${lastowner}" fi fi case "${setlicense}" in ?*/?*) setlicowner="`echo \"${setlicense}\" | ${AWK} -F/ '{print $1}'`" setlicense="`echo \"${setlicense}\" | ${AWK} -F/ '{print $2}'`" ;; *) ;; esac if [ -z "${setlicense}" ]; then if [ -n "${parm_lickey[${netif}]}" ]; then license="${parm_lickey[${netif}]}" else license="" fi else license="`disptokey \"${setlicense}\"`" fi ask_licowner || return 1 parm_licowner[${netif}]="${licowner}" ask_license || return 1 parm_lickey[${netif}]="${license}" if ! dldrstop >/dev/null 2>&1; then sleep 1 # retry if ! dldrstop >/dev/null 2>&1; then echo "" echo "Unable to unload driver to configure license; adapter in use?" echo "\"License status\" information might not be up to date." echo "Please reboot your computer." fi fi sleep 1 echo "" echo "Setting license for interface ${parm_netifname[${netif}]}: \"${parm_licowner[${netif}]}/`keytodisp \"${parm_lickey[${netif}]}\"`\"" cfgfile=${dldrnvmdir}/${parm_hwid[${netif}]} if [ ! -e ${cfgfile} ]; then touch ${cfgfile} fi if ( sed -e '/^License/d' echo "LicenseOwner=\"${parm_licowner[${netif}]}\"" echo "LicenseKey=0x${parm_lickey[${netif}]}" ) < ${cfgfile} > ${cfgfile}.$$; then if ! cp ${cfgfile}.$$ ${cfgfile}; then rm -f ${cfgfile}.$$ ${outcfgfile} exit 1 fi fi rm -f ${cfgfile}.$$ [ -n "${parm_licowner[${netif}]}" -a "${parm_licowner[${netif}]}" != "unknown" ] && lastowner="${parm_licowner[${netif}]}" rereadparms=true res=$? return ${res} } ask_netdevname() { while true; do if [ -n "${setnetdevname}" ]; then answer="${setnetdevname}" elif ${automode}; then if [ -z "${netdevname}" ]; then return 1 fi answer="${netdevname}" else echo "" echo "Note: %d will be substituted with device instance number" echo "i.e. wlan%d becomes wlan0, wlan1, and so on.." echo "" echo -n "Please enter desired network interface name [$netdevname]: " read answer case "${answer}" in "" | *"[ ]"*) answer="${netdevname}" ;; *) answer="`echo \"${answer}\" | tr '[A-Z]' '[a-z]' | tr -d '[ \012]'`" ;; esac fi # case "${answer}" in # ?*@?*.?*) netdevname="${answer}" return 0 # ;; # *) # if ! ${automode} || [ "${answer}" != "" ]; then # echo "" # echo "ERROR: Invalid network interface name format: \"${answer}\"." # fi # if ${automode}; then # return 1 # fi # setnetdevname="" # ;; # esac done } configure_netdevname() { netdevname="${setnetdevname}" if [ -z "${netdevname}" -a -n "${parm_netdevname[${netif}]}" ]; then netdevname="${parm_netdevname[${netif}]}" fi if [ -z "${netdevname}" ]; then netdevname="eth%d" fi ask_netdevname || return 1 parm_netdevname[${netif}]="${netdevname}" if ! dldrstop >/dev/null 2>&1; then sleep 1 # retry if ! dldrstop >/dev/null 2>&1; then echo "" echo "Unable to unload driver to configure network interface name format; adapter in use?" echo "Please reboot your computer." fi fi sleep 1 echo "" echo "Setting device name format for interface ${parm_netifname[${netif}]} to \"${parm_netdevname[${netif}]}\"" cfgfile=${dldrcnfdir}/${parm_hwid[${netif}]} if [ ! -e ${cfgfile} ]; then touch ${cfgfile} fi if ( sed -e '/^DriverLoaderNetDevName/d' echo "DriverLoaderNetDevName=\"${parm_netdevname[${netif}]}\"" ) < ${cfgfile} > ${cfgfile}.$$; then if ! cp ${cfgfile}.$$ ${cfgfile}; then rm -f ${cfgfile}.$$ ${outcfgfile} exit 1 fi fi rm -f ${cfgfile}.$$ rereadparms=true res=$? return ${res} } ask_webconf() { while true; do if [ -n "${setwebconf}" ]; then answer="${setwebconf}" elif ${automode}; then if [ -z "${webconf}" ]; then return 1 fi answer="${webconf}" else echo "" echo -n "Please enter address:port for web configurator or "off" to disable it [$webconf]: " read answer case "${answer}" in "" | *"[ ]"*) answer="${webconf}" ;; *) answer="`echo \"${answer}\" | tr '[A-Z]' '[a-z]' | tr -d '[ \012]'`" ;; esac fi case "${answer}" in ?*:?* | [oO][fF][fF]) webconf="${answer}" return 0 ;; *) if ! ${automode} || [ "${answer}" != "" ]; then echo "" echo "ERROR: Invalid address:port format: \"${answer}\"." fi if ${automode}; then return 1 fi setwebconf="" ;; esac done } configure_webconf() { webconf="${setwebconf}" if [ -z "${webconf}" -a -n "${parm_webconf}" ]; then webconf="${parm_webconf}" fi if [ -z "${webconf}" ]; then webconf="127.0.0.1:18020" fi ask_webconf || return 1 parm_webconf="${webconf}" parm_webconfport="`echo \"${parm_webconf}\" | awk -F: '{print $2}'`" DLDRHELPERACTION=stop /usr/lib/driverloader/webconfd echo "" echo "Setting web configurator to \"${parm_webconf}\"" echo "${parm_webconf}" > "${dldrnvmdir}/webconf" res=$? case "${parm_webconf}" in ?*:?*) sleep 1 DLDRHELPERACTION=start /usr/lib/driverloader/webconfd ;; *) ;; esac return ${res} } use_prebuilt_modules() { rm -f "/lib/modules/${OSKERNVERS}/misc/driverloader"*.${KO} if [ ! -d "/lib/modules/${OSKERNVERS}/misc" ]; then mkdir -p "/lib/modules/${OSKERNVERS}/misc" fi ln -s "${dldrlibdir}/modules/binaries/$1/driverloader"*.${KO} "/lib/modules/${OSKERNVERS}/misc/" } files_present() { for f; do if [ ! -f "${f}" ]; then missing_file="${f}" return 1 fi done } remove_temp_kernel_tree() { if [ -n "${KERNELORG}" ]; then rm -rf "${KERNELSRC}" KERNELSRC="${KERNELORG}" KERNELORG="" return 0 fi return 1 } create_temp_kernel_tree() { KERNELORG="${KERNELSRC}" # get absolute pathname with cd/pwd to ensure that our temp dir # is on same filesystem due to use of hardlinks by cp -al KERNELSRC="`(cd \"${KERNELORG}\" && /bin/pwd)`-dldrtmp$$" rm -rf "${KERNELSRC}" if ! cp -al "${KERNELORG}/." "${KERNELSRC}"; then remove_temp_kernel_tree return 1 fi return 0 } kernelrebuild_instructions() { echo "" echo "First, ensure that the proper kernel source and compiler packages" echo "from your distribution vendor and/or the commnetify are installed." echo "" echo "The Linux kernel can then be reconfigured by running \"make menuconfig\"" echo "under the kernel source directory (usually /usr/src/linux)." echo "" echo "Verify that the proper options for your system are selected." echo "" echo "Then compile and install your new kernel (for more information about" echo "this procedure, see the README file under the kernel source directory)," echo "reboot the system using the new kernel, and re-run \"dldrconfig\"." } check_kernel() { # if [ -n "$OSKERNSMP" ]; then # echo 1>&2 "" # echo 1>&2 "This driver has not been fully tested on SMP kernels." # echo 1>&2 "Please report results to <support@linuxant.com>" # fi case "${OSKERNVERS}" in 2.2*) echo "" echo 1>&2 "ERROR: 2.2 kernels are no longer supported by this driver!" echo 1>&2 "Please upgrade your Linux distribution or kernel to version 2.4 or 2.6" return 1 ;; *) ;; esac return 0 } right_version_file() { _versionf="$1" FILEKERNELVER="`echo UTS_RELEASE | gcc -E -I"${KERNELSRC}/include" -include "${_versionf}" - | grep '^"' | tr -d '" '`" [ "${OSKERNVERS}" = "${FILEKERNELVER}" ] } update_module_dependencies() { depmod -a -e -u >/tmp/dldrconf.depmod.$$ 2>&1 res=$? cat 1>&2 /tmp/dldrconf.depmod.$$ if [ ${res} -ne 0 ]; then # only return error if one of our modules is at cause grep -q "driverloader" /tmp/dldrconf.depmod.$$ || res=0 fi rm -f /tmp/dldrconf.depmod.$$ return ${res} } recompile_modules() { KERNELSRC=/usr/src/linux KERNELORG="" if [ -h /lib/modules/${OSKERNVERS}/build -a ! -d /lib/modules/${OSKERNVERS}/build/. ]; then echo "" echo "ERROR: /lib/modules/${OSKERNVERS}/build points to a missing directory" echo "" ls -l /lib/modules/${OSKERNVERS}/build echo "" echo "Please ensure that the kernel-headers or kernel-source package is installed." return 1 fi if [ -d /lib/modules/${OSKERNVERS}/build/include ]; then KERNELSRC=/lib/modules/${OSKERNVERS}/build elif [ ! -d "${KERNELSRC}" -a -d "/usr/src/kernel-headers-${OSKERNVERS}" ]; then # Debian KERNELSRC=/usr/src/kernel-headers-${OSKERNVERS} elif [ ! -d "${KERNELSRC}" -a -d "/usr/local/src/linux" ]; then KERNELSRC=/usr/local/src/linux elif [ ! -d "${KERNELSRC}" ]; then echo "Please ensure that the kernel-headers or kernel-source package is installed." if [ "${OSDISTNAME}" = Debian ]; then echo "On Debian, try \"apt-get install kernel-headers-${OSKERNVERS}\"" fi fi if ! $automode; then echo "" echo "Where is the linux source build directory that matches your running kernel?" echo -n "[${KERNELSRC}] " read answer case "${answer}" in "") ;; *) KERNELSRC="${answer}" ;; esac fi if [ -e "${KERNELSRC}/scripts/Makefile.build" ]; then use_kbuild=true else use_kbuild=false fi if ! files_present \ "${KERNELSRC}/include/linux/autoconf.h" \ "${KERNELSRC}/include/linux/version.h" || (! ${use_kbuild} && ! files_present "${KERNELSRC}/include/linux/modversions.h"); then echo "" echo "WARNING: missing file ${missing_file}" suspect_tree=true elif ! right_version_file "${KERNELSRC}/include/linux/version.h"; then echo "" echo "WARNING: the kernel version (${FILEKERNELVER}) defined in" echo "${KERNELSRC}/include/linux/version.h" echo "does not match the currently running kernel (${OSKERNVERS})" echo "The cause of this problem is an incorrect kernel source path." echo "Please check that ${KERNELSRC} points to the right tree." suspect_tree=true else suspect_tree=false fi if ${suspect_tree}; then echo "The cause of this problem is usually a missing or misconfigured" echo "kernel source tree (and sometimes an incorrect directory or symbolic link)." # SuSE has copies of autoconf.h and version.h available under /boot if [ -d "${KERNELSRC}/include/linux" -a -f /boot/vmlinuz.autoconf.h -a -f /boot/vmlinuz.version.h ] && right_version_file /boot/vmlinuz.version.h && [ -f "${KERNELSRC}/include/linux/modversions.h" ]; then echo "" echo "However, proper /boot/vmlinuz.{autoconf.h,version.h} were found." if ask_yesno "Would you like to try using them (in a temporary kernel tree)? [yes] " 0; then if ! create_temp_kernel_tree; then echo "" echo "Unable to create temporary kernel tree" kernelrebuild_instructions return 1 fi rm -f "${KERNELSRC}/include/linux/.config" \ "${KERNELSRC}/include/linux/autoconf.h" \ "${KERNELSRC}/include/linux/version.h" if ! cp -p /boot/vmlinuz.autoconf.h "${KERNELSRC}/include/linux/autoconf.h" || \ ! cp -p /boot/vmlinuz.version.h "${KERNELSRC}/include/linux/version.h"; then echo "" echo "Unable to copy files to temporary kernel tree" remove_temp_kernel_tree kernelrebuild_instructions return 1 fi # we don't really need .config but it can't hurt if available if [ -f /boot/vmlinuz.config ]; then cp -p /boot/vmlinuz.config "${KERNELSRC}/include/linux/.config" fi fi fi fi # are we ok now? if [ ! -f "${KERNELSRC}/include/linux/version.h" \ -o ! -f "${KERNELSRC}/include/linux/autoconf.h" ] || \ [ ! -f "${KERNELSRC}/include/linux/modversions.h" ] && ! ${use_kbuild}; then remove_temp_kernel_tree kernelrebuild_instructions return 1 fi buildlogf=/tmp/dldrconfig-buildlog.txt # set FILEKERNELVER if it isn't already [ -n "${FILEKERNELVER}" ] || right_version_file "${KERNELSRC}/include/linux/version.h" echo "" echo "Building modules for kernel ${FILEKERNELVER}, using source directory" echo "${KERNELSRC}. Please wait..." (cd ${dldrlibdir}/modules && make "KERNELSRC=${KERNELSRC}" clean minstall) > ${buildlogf} 2>&1 res=$? (cd ${dldrlibdir}/modules && make "KERNELSRC=${KERNELSRC}" clean) >/dev/null 2>&1 remove_temp_kernel_tree if [ $res -eq 0 ]; then rm -f ${buildlogf} return 0 else echo "" echo "ERROR: Module build failed!" echo "Please examine the log file \"${buildlogf}\" to determine why." return 1 fi } modules_exist() { files_present "/lib/modules/${OSKERNVERS}/misc/driverloader"*.${KO} } remove_kernel_modules() { modules_removed=false for f in "/lib/modules/"*"/misc/driverloader"*.*o; do if [ ! -e "${f}" ]; then continue fi rm -f "${f}" modules_removed=true done if ${modules_removed}; then echo "" echo "Removed driverloader from /lib/modules/" update_module_dependencies fi return 0 } binary_modules_avail() { [ -d "${dldrlibdir}/modules/binaries/$1" ] } configure_kernel() { check_kernel || return $? if modules_exist; then echo "" echo "Warning: existing driver modules found under:" echo " /lib/modules/${OSKERNVERS}/misc/" if ask_yesno "Would you like to keep using them? [no] " 1; then return 0 fi fi chosen_binary_modules="" if binary_modules_avail "${OSKERNTYPE}/${OSDISTIDNT}/${OSKERNNAME}-${OSKERNVERS}${OSKERNSMP}"; then chosen_binary_modules="${OSKERNTYPE}/${OSDISTIDNT}/${OSKERNNAME}-${OSKERNVERS}${OSKERNSMP}" fi if [ -n "${chosen_binary_modules}" ]; then echo "" echo "Pre-built driver modules that seem compatible with your system were found under" echo "${dldrlibdir}/modules/binaries/${chosen_binary_modules}." if ask_yesno "Would you like to use them? [yes] " 0; then if use_prebuilt_modules "${chosen_binary_modules}"; then dldrstop # unload any old modules loaded update_module_dependencies || return $? return 0 fi fi else echo "" echo "No pre-built modules for: ${OSDISTNAME}-${OSDISTVERS} ${OSKERNNAME}-${OSKERNVERS} ${OSKERNTYPE}${OSKERNSMP}" fi if [ -f ${dldrlibdir}/modules/Makefile ]; then echo "" echo "Trying to automatically build the driver modules..." echo "(this requires a C compiler and proper kernel sources to be installed)" if recompile_modules; then dldrstop # unload any old modules loaded update_module_dependencies || return $? echo "done." return 0 fi else echo "" echo "Please obtain the appropriate variant of this package for your system" echo "or try the generic RPM or tar version." fi return 1 } modconf_filter_mine() { if [ "$1" = all ]; then regex="[a-zA-Z][a-zA-Z]*[0-9][0-9]*" else regex="" for n in "${parm_netifname[@]}"; do if [ -z "${n}" ]; then continue fi if [ -n "${regex}" ]; then regex="${regex}|${n}" else regex="${n}" fi done fi egrep -v "^(alias[ ][ ]*(${regex})[ ][ ]*driverloader)|(options[^#]*driverloader)" } unconfigure_mods() { if [ -f /etc/modutils/driverloader ]; then rm -f /etc/modutils/driverloader update-modules elif [ -f /etc/modules.d/driverloader ]; then rm -f /etc/modules.d/driverloader update-modules else if modconf_filter_mine all < ${modulesconf} > ${modulesconf}.$$; then cp ${modulesconf}.$$ ${modulesconf} fi rm -f ${modulesconf}.$$ fi if [ -n "${modprobeconf}" -a -f "${modprobeconf}" ]; then if modconf_filter_mine all < ${modprobeconf} > ${modprobeconf}.$$; then cp ${modprobeconf}.$$ ${modprobeconf} fi rm -f ${modprobeconf}.$$ fi } mod_aliases_and_options() { for n in "${parm_netifname[@]}"; do if [ -z "${n}" ]; then continue fi if ! modprobe -c 2> /dev/null | grep -q "^alias[ ][ ]*${n}[ ]"; then echo "alias ${n} driverloader" fi if [ "${OSDISTNAME}" = "SuSE" -a -d "/etc/sysconfig/network" -a ! -e "/etc/sysconfig/network/ifcfg-${n}" ]; then # Create empty ifcfg so that YaST detects the interface touch /etc/sysconfig/network/ifcfg-${n} fi done } configure_mods() { if [ "`sysctl -n kernel.modprobe`" = "/bin/true" ]; then echo "" echo "WARNING: kernel.modprobe parameter set to /sbin/true; automatic module loading will not work!" if [ "${ksyms}" = "kallsyms" ]; then echo "The cause of this problem is usually a check for /proc/ksyms (2.4) instead of /proc/kallsyms (2.6)" if [ -e /etc/rc.d/rc.sysinit ]; then echo "possibly in /etc/rc.d/rc.sysinit" else echo "in the system's startup scripts" fi fi fi if [ -d /etc/modutils -a -x /sbin/update-modules ]; then # Debian runupdatemodules=true outmodulesconf=/etc/modutils/driverloader elif [ -d /etc/modules.d -a -x /usr/sbin/update-modules ]; then # Gentoo runupdatemodules=true outmodulesconf=/etc/modules.d/driverloader else runupdatemodules=false outmodulesconf=/tmp/dldrmodconf.$$ fi mod_aliases_and_options modulesconf > ${outmodulesconf} if ${runupdatemodules}; then update-modules else if cat ${modulesconf} ${outmodulesconf} > ${modulesconf}.$$; then if ! cmp --silent ${modulesconf}.$$ ${modulesconf}; then if ! cp ${modulesconf}.$$ ${modulesconf}; then rm -f ${modulesconf}.$$ ${outmodulesconf} exit 1 fi fi fi rm -f ${modulesconf}.$$ ${outmodulesconf} fi if [ -n "${modprobeconf}" ]; then outmodprobeconf=/tmp/dldrmodconf.$$ mod_aliases_and_options > ${outmodprobeconf} if cat ${modprobeconf} ${outmodprobeconf} > ${modprobeconf}.$$; then if ! cmp --silent ${modprobeconf}.$$ ${outmodprobeconf}; then if ! cp ${modprobeconf}.$$ ${modprobeconf}; then rm -f ${modprobeconf}.$$ ${outmodprobeconf} exit 1 fi fi fi rm -f ${modprobeconf}.$$ ${outmodprobeconf} fi } identify_system() { OSDISTNAME=unknown OSDISTIDNT=unknown OSDISTVERS=unknown if [ -f /etc/debian_version ]; then OSDISTNAME=Debian OSDISTIDNT=deb read OSDISTVERS < /etc/debian_version elif [ -f /etc/slackware-version ]; then OSDISTNAME=Slackware OSDISTIDNT=slack OSDISTVERS="`${AWK} '{print $1; exit}' /etc/slackware-version`" elif [ -f /etc/conectiva-release ]; then OSDISTNAME=Conectiva OSDISTIDNT=conectiva elif [ -f /etc/SuSE-release ]; then OSDISTNAME=SuSE OSDISTIDNT=suse OSDISTVERS="`sed -n '/^VERSION/s/^.*=[ ]*//p' < /etc/SuSE-release`" elif [ -f /etc/mandrake-release ]; then OSDISTNAME=Mandrake OSDISTIDNT=mdk #it would be better to use rpm instead of sed but it doesn't work #recursively (due to database locking) when this script is called during #the package's installation # OSDISTVERS="`rpm -q --queryformat '%{VERSION}\n' mandrake-release | sort -r | head -1`" OSDISTVERS="`sed -n '/release /{s/^.*release *\([^ ]*\)/\1/;s/ .*//;p;q;}' < /etc/mandrake-release`" #elif [ -f /etc/yellowdog-release ]; then # OSDISTNAME=YellowDog elif [ -f /etc/turbolinux-release ]; then OSDISTNAME=Turbolinux OSDISTIDNT=turbo OSDISTVERS="`sed -n '/release /{s/^.*release *\([^ ]*\)/\1/;s/ .*//;p;q;}' < /etc/turbolinux-release`" if [ -z "${OSDISTVERS}" ]; then OSDISTVERS="`sed -n '/[a-zA-Z][a-zA-Z]* /{s/^.*[a-zA-Z][a-zA-Z]* *\([^ ]*\)/\1/;s/ .*//;p;q;}' < /etc/turbolinux-release`" fi elif [ -f /etc/fedora-release ]; then OSDISTNAME=Fedora OSDISTIDNT=fdr OSDISTVERS="`sed -n '/release /{s/^.*release *\([^ ]*\)/\1/;s/ .*//;p;q;}' < /etc/fedora-release`" elif [ -f /etc/redhat-release ]; then OSDISTNAME=RedHat OSDISTIDNT=rh OSDISTVERS="`sed -n '/release /{s/^.*release *\([^ ]*\)/\1/;s/ .*//;p;q;}' < /etc/redhat-release`" elif [ -d /var/lib/LST ]; then OSDISTNAME=Caldera OSDISTIDNT=caldera fi OSKERNNAME="`uname -s | tr '[A-Z]' '[a-z]'`" OSKERNARCH="`uname -m`" if [ -r /boot/kernel.h ]; then OSKERNTYPE="`sed -n '/^#define[ ]__MODULE_KERNEL_/s/^#define[ ]__MODULE_KERNEL_\([^ ]*\)[ ]*.*/\1/p' </boot/kernel.h`" fi if [ -z "${OSKERNTYPE}" ]; then OSKERNTYPE="${OSKERNARCH}" fi OSKERNVERS="`uname -r`" case "${OSKERNVERS}" in 2.[234]*) KO=o ksyms=ksyms ;; *) KO=ko ksyms=kallsyms ;; esac if uname -v | grep -q SMP; then OSKERNSMP="-SMP" else OSKERNSMP="" fi if [ -r /proc/ksyms ] && [ `egrep -c '_[0-9a-f]{8}$' /proc/ksyms` -gt 100 ]; then OSKERNMODV="-MODVERS" else OSKERNMODV="" fi echo "$OSKERNNAME-$OSKERNARCH($OSKERNTYPE)-$OSKERNVERS$OSKERNSMP$OSKERNMODV $OSDISTNAME-$OSDISTVERS" } dump_cmd() { echo "" echo "${dumpprefix} $*" eval $@ } dump_file() { dump_cmd cat -v $@ } dump_diagnostics() { dumpprefix="+" > "${dldrdiagfile}" || return $? if ! ${noprobe}; then echo "" echo "Probing \"driverloader\"..." ( dump_cmd dldrstop dump_cmd modprobe -v driverloader dump_cmd lsmod ) >> "${dldrdiagfile}" 2>&1 fi echo "" echo "Dumping system diagnostic information..." case "${dldrdiagfile}" in *longdiag*) longdiag=true ;; *) longdiag=false ;; esac ( dump_cmd date dump_cmd $0 --info dump_cmd identify_system dump_cmd uname -a dump_cmd gcc -v dump_file /proc/version dump_file /proc/cpuinfo for f in /etc/*_version /etc/*-version /etc/*-release; do if [ -r "${f}" ]; then dump_file "${f}" fi done dump_cmd dmesg if dmesg | grep -qi 'panic'; then dump_cmd dmesg | ksymoops fi for f in /var/log/driverloader /etc/sysconfig/network-scripts/ifcfg-* /etc/sysconfig/network/ifcfg-*; do if [ -r "${f}" ]; then dump_file "${f}" fi done dump_cmd iwconfig --version dump_cmd iwconfig dump_cmd iwlist accesspoints dump_cmd iwlist scanning dump_cmd iwlist scanning dump_cmd iptables -L -n -v dump_cmd ifconfig -a dump_cmd netstat -rn dump_cmd netstat -in dump_cmd ip addr dump_cmd ip rule dump_cmd ip route dump_cmd lspci -n dump_cmd lspci -v dump_cmd lspci -n -vvv for p in pci cmdline uptime \ devices misc filesystems interrupts \ iomem ioports dma mtrr \ partitions mounts swaps meminfo \ stat apm modules do dump_file /proc/${p} done dump_cmd env dump_cmd sysctl -a dump_cmd modprobe -V dump_cmd modprobe -l "*driverloader*" dump_file "${modulesconf}" if [ -n "${modprobeconf}" ]; then dump_file "${modprobeconf}" fi dump_cmd depmod -e -a dump_cmd "cd ${dldrcnfdir} && find . -ls" dump_cmd "cd ${dldrcnfdir} && find . -print -type f -exec cat {} \;" dump_cmd "cd ${dldrnvmdir} && find . -ls" dump_cmd "cd ${dldrnvmdir} && find . -print -type f -exec cat {} \;" dump_cmd ls -lR "${dldrlibdir}/." dump_cmd "( cd ${dldrlibdir} && for f in webconfd webconfdocs/cgi-bin/*.cgi; do \ perl -c \${f}; done )" dump_cmd ls -lR "${dldrvardir}/." dump_cmd "cd ${dldrvardir} && find . -name '*.inf' -type f -print -exec cat {} \;" dump_cmd "cd ${dldrvardir} && find . -name '*.sys' -type f -print -exec strings -e l {} \;" # for f in ${dldrvardir}/*.inf; do # if [ -r "${f}" ]; then # dump_file "${f}" # fi # done # for f in ${dldrvardir}/*.sys; do # if [ -r "${f}" ]; then # dump_cmd strings -e l "${f}" # fi # done dump_cmd ls -lR /lib/modules/${OSKERNVERS}/misc if ${longdiag}; then for p in slabinfo ${ksyms} do dump_file /proc/${p} done dump_file /lib/modules/${OSKERNVERS}/build/.config dump_file /lib/modules/${OSKERNVERS}/build/include/linux/version.h dump_file /lib/modules/${OSKERNVERS}/build/include/linux/autoconf.h dump_file /lib/modules/${OSKERNVERS}/build/include/linux/autoconf-up.h dump_file /lib/modules/${OSKERNVERS}/build/include/linux/rhconfig.h dump_file /lib/modules/${OSKERNVERS}/build/include/linux/modules/ksyms.ver dump_file /boot/vmlinuz.version.h dump_file /boot/vmlinuz.autoconf.h dump_file /boot/vmlinuz.config dump_file /boot/kernel.h dump_cmd ls -lR /etc/. dump_cmd ls -lR /lib/modules/. dump_cmd ls -lR /boot/. dump_cmd ls -l /usr/src/linux/include/. dump_cmd ls -l /usr/src/linux/include/linux/. dump_cmd ls -l /usr/src/linux/include/asm-i386/. dump_cmd ls -l /usr/include/. /usr/src/. dump_cmd env dump_cmd ps -efw dump_cmd sh --version dump_cmd sed --version dump_cmd ${AWK} --version dump_cmd printf --version dump_cmd tar --version dump_cmd rpm --version dump_cmd rpm --showrc dump_cmd rpm --query --all fi ) >> "${dldrdiagfile}" 2>&1 if [ -f "${dldrdiagfile}" ]; then echo "" echo "System diagnostic information has been saved to the file:" echo "" ls -l ${dldrdiagfile} echo "" echo "As it could contain private information about this system, we recommend that" echo "you verify its contents before sending it to third parties." fi } read_netif_parms() { netifname="$1" parm_hwinst[${netif}]="none" parm_hwid[${netif}]="unknown" parm_licowner[${netif}]="${lastowner}" parm_lickey[${netif}]="00000000" parm_licstatus[${netif}]="unknown" parm_drvname[${netif}]="" parm_vendordsc[${netif}]="" parm_driverdsc[${netif}]="" parm_adaptermdl[${netif}]="" parm_netifname[${netif}]="${netifname}" parm_netdevname[${netif}]="" if [ ! -d "${procdrvdir}/${netifname}" ]; then echo "" echo 1>&2 "ERROR: no adapter found (interface ${netifname})" return 1 fi read parm_hwinst[${netif}] < ${procdrvdir}/${netifname}/hwinst read parm_hwid[${netif}] < ${procdrvdir}/${netifname}/hwaddr parm_drvname[${netif}]="`sed -n '/^DriverName=/ s/\"//g; s/^DriverName=//p' < \"${dldrcnfdir}/${parm_hwid[${netif}]}\"`" parm_vendordsc[${netif}]="`sed -n '/^VendorDesc=/ s/\"//g; s/^VendorDesc=//p' < \"${dldrcnfdir}/${parm_hwid[${netif}]}\"`" parm_driverdsc[${netif}]="`sed -n '/^DriverDesc=/ s/\"//g; s/^DriverDesc=//p' < \"${dldrcnfdir}/${parm_hwid[${netif}]}\"`" parm_driverver[${netif}]="`sed -n '/^DriverVersion=/ s/\"//g; s/^DriverVersion=//p' < \"${dldrcnfdir}/${parm_hwid[${netif}]}\"`" parm_adapterdsc[${netif}]="`sed -n '/^AdapterDesc=/ s/\"//g; s/^AdapterDesc=//p' < \"${dldrcnfdir}/${parm_hwid[${netif}]}\"`" parm_adaptermdl[${netif}]="`sed -n '/^AdapterModel=/ s/\"//g; s/^AdapterModel=//p' < \"${dldrcnfdir}/${parm_hwid[${netif}]}\"`" parm_netdevname[${netif}]="`sed -n '/^DriverLoaderNetDevName=/ s/\"//g; s/^DriverLoaderNetDevName=//p' < \"${dldrcnfdir}/${parm_hwid[${netif}]}\"`" if ${isfreeversion}; then sawinvalidlicenses=true else read parm_licstatus[${netif}] < ${procdrvdir}/${netifname}/licstatus if [ -f "${dldrnvmdir}/${parm_hwid[${netif}]}" ]; then parm_lickey[${netif}]="`sed -n '/^LicenseKey=/ s/\"//g; s/^LicenseKey=0x//p' < \"${dldrnvmdir}/${parm_hwid[${netif}]}\"`" parm_licowner[${netif}]="`sed -n '/^LicenseOwner=/ s/\"//g; s/^LicenseOwner=//p' < \"${dldrnvmdir}/${parm_hwid[${netif}]}\"`" if [ -z "${parm_licowner[${netif}]}" ]; then parm_licowner[${netif}]="unknown" fi [ -n "${parm_licowner[${netif}]}" -a "${parm_licowner[${netif}]}" != "unknown" ] && lastowner="${parm_licowner[${netif}]}" fi case "${parm_licstatus[${netif}]}" in *INVALID* | *EXPIRED*) sawinvalidlicenses=true ;; *) ;; esac fi return 0 } ensure_driver_present() { if [ ! -f ${dldrcnfdir}/.perlmodsok ]; then ( perlmodsok=true cd ${dldrlibdir} for f in webconfd webconfdocs/cgi-bin/*.cgi; do if ! perl -c ${f} >/tmp/dldrconf.perl.$$ 2>&1; then perlmodsok=false echo "" cat /tmp/dldrconf.perl.$$ 1>&2 echo "" echo 1>&2 "ERROR: perl module syntax checking failed. Web configurator will not work" echo "Perhaps you need to install the \"perl-CGI\" package to fix this problem" break fi done rm -f /tmp/dldrconf.perl.$$ ${perlmodsok} && touch ${dldrcnfdir}/.perlmodsok ) fi if [ ! -d ${procdrvdir} ]; then modprobe driverloader >/dev/null 2>&1 # ensure drv loaded if [ ! -d ${procdrvdir} ]; then #echo "" #echo 1>&2 "ERROR: driverloader not active" return 1 fi fi return 0 } read_parms() { sawinvalidlicenses=false if [ -s "${dldrnvmdir}/webconf" ]; then read parm_webconf < "${dldrnvmdir}/webconf" parm_webconfport="`echo \"${parm_webconf}\" | awk -F: '{print $2}'`" else parm_webconf="" parm_webconfport="" fi ensure_driver_present || return $? numnetifs=0 netifs="${specificnetif}" if [ -z "${netifs}" ]; then netifs="`find ${procdrvdir} -maxdepth 1 -type d | sed -n -e \"s@${procdrvdir}/*@@\" -e '/^..*/p'`" if [ -z "${netifs}" ]; then echo "" echo 1>&2 "No devices detected by driverloader" return 1 fi fi for n in ${netifs}; do netif=${numnetifs} read_netif_parms ${n} || return $? numnetifs=`expr ${numnetifs} + 1` done rereadparms=false } show_netif_parms() { echo "" if [ -n "${parm_netdevname[${netif}]}" -a "${parm_netdevname[${netif}]}" != "${parm_netifname[${netif}]}" ]; then echo "Wireless interface name: ${parm_netifname[${netif}]} (format \"${parm_netdevname[${netif}]}\")" else echo "Wireless interface name: ${parm_netifname[${netif}]}" fi echo " MAC address : ${parm_hwid[${netif}]}" echo " Device instance: ${parm_hwinst[${netif}]}" if [ -n "${parm_drvname[${netif}]}" ]; then echo " Device driver : ${parm_drvname[${netif}]}" fi if [ -n "${parm_driverver[${netif}]}" ]; then echo " Driver Version : ${parm_driverver[${netif}]}" fi if [ -n "${parm_vendordsc[${netif}]}" ]; then echo " Description : ${parm_vendordsc[${netif}]}" fi if [ -n "${parm_driverdsc[${netif}]}" ]; then echo " Description : ${parm_driverdsc[${netif}]}" fi if [ -n "${parm_adapterdsc[${netif}]}" ]; then echo " Description : ${parm_adapterdsc[${netif}]}" fi if [ -n "${parm_adaptermdl[${netif}]}" ]; then echo " Adapter model : ${parm_adaptermdl[${netif}]}" fi if ! ${isfreeversion}; then echo " License owner : ${parm_licowner[${netif}]}" echo " License key : `keytodisp \"${parm_lickey[${netif}]}\"`" echo " License status : ${parm_licstatus[${netif}]}" fi } show_intro() { echo "Linuxant DriverLoader for Wireless LAN devices, version ${dldrversion}" case "${dldrversion}" in *beta*) ( echo "" echo "WARNING: this is an EXPERIMENTAL BETA VERSION. USE AT YOUR OWN RISK!" echo "See the file ${dldrlibdir}/LICENSE for details." ) 1>&2 ;; esac } show_webconf_url() { case "${parm_webconf}" in 127.1:* | 127.0.0.1:* | localhost:*) echo " http://127.0.0.1:${parm_webconfport}/" ;; 0.0.0.0* | "*"*) echo " http://127.0.0.1:${parm_webconfport}/ or http://`hostname`:${parm_webconfport}/" ;; *) echo " http://${parm_webconf}/" ;; esac ensure_driver_present } show_finish_info() { givewebconfurl="$1" ( echo "" echo "If you need license keys, assistance or more information, please go to:" echo " http://www.linuxant.com/" echo "" echo "When reporting a problem for the first time, please send" echo "us the file generated by \"dldrconfig --dumpdiag\"." ) 1>&2 if ${givewebconfurl}; then ( case "${parm_webconf}" in ?*:?*) echo "" echo "To complete the installation, please point your browser to:" show_webconf_url ;; *) echo "" echo "Web configurator disabled; please re-enable it with \"dldrconfig --webconf\"" echo "or complete the installation manually." ;; esac ) 1>&2 fi } show_usage_and_exit() { show_intro cat 1>&2 << EOT Usage: `basename $0` [options] --netif=<name> Select specific network interface -k, --kernel Build and install kernel modules -m, --modalias Add module aliases -i, --info Show current configuration information -l, --license[=<owner/key>] Set license key --netdevname[=<format>] Set network interface name format (%d is substituted with instance number, so "eth%d" automatically becomes eth0, eth1, etc..) --webconf[=<addr:port>] Set listen address for web configurator Defaults to 127.0.0.1:18020 Use "off" to disable it completely, or "*:18020" to make it accessible from other machines (not recommended). --newinstance=<hwinst> Add new device instance (used internally) --verifymac=<macaddr> Ensure macaddr == hwinst (used internally) -d, --dumpdiag[=<file>] Probe driver modules and dump system diagnostic information to <file> (default: ${dldrdiagfile}) -N, --noprobe Do dumpdiag without probing modules (safer) -a, --auto Run in automatic mode, without prompting user -r, --remove Remove kernel modules and related config -h, --help This small usage guide -V, --version Show version Default options if none selected: --kernel --modalias --license --info EOT exit 1 } # end of functions; execution starts here PATH=/usr/sbin:/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin export PATH unset LANG umask 022 dldrlibdir="/usr/lib/driverloader" dldrvardir="/var/lib/driverloader" dldretcdir="/etc/driverloader" dldrnvmdir="/etc/driverloader/static" dldrcnfdir="/etc/driverloader/config" dldrinfdir="/tmp/no/longer/used" dldrinffil="/tmp/no/longer/used" dldrversion="1.57" if which gawk >/dev/null 2>&1; then AWK=gawk else AWK=awk fi identify_system >/dev/null if id -u >/dev/null 2>&1; then if [ "`id -u`" != 0 ]; then echo 1>&2 "$0: root priviledges required." echo 1>&2 "Please run \"su - root\" before this command." exit 1 fi fi case "${dldrversion}" in *free*) isfreeversion=true ;; *) isfreeversion=false ;; esac dldrdiagfile="/tmp/driverloaderdiag.txt" if [ -f /etc/modules.conf ]; then modulesconf=/etc/modules.conf if [ -f "${modulesconf}.local" ]; then # SuSE 9.0 modulesconf="${modulesconf}.local" fi elif [ -f /etc/conf.modules ]; then modulesconf=/etc/conf.modules else # create /etc/modules.conf if it doesn't exist modulesconf=/etc/modules.conf touch ${modulesconf} fi if [ -f /etc/modprobe.conf ]; then modprobeconf=/etc/modprobe.conf if [ -f "${modprobeconf}.local" ]; then # SuSE 9.0 modprobeconf="${modprobeconf}.local" fi elif which generate-modprobe.conf >/dev/null 2>&1; then modprobeconf=/etc/modprobe.conf # create /etc/modprobe.conf if it doesn't exist touch ${modprobeconf} fi TEMP=`getopt -a -o C::M::kmil::d::NarhV --long netif:,newinstance:,verifymac:,kernel,modalias,info,license::,netdevname::,webconf::,dumpdiag::,noprobe,auto,remove,help,version -n "\`basename $0\`" -- "$@"` if [ $? != 0 ]; then show_usage_and_exit fi eval set -- "$TEMP" automode=false noprobe=false do_cfgkernel=false do_cfgmods=false do_cfglicense=false do_cfgnetdevname=false do_cfgwebconf=false do_cfgnewinstance=false do_cfgverifymac=false do_infocfg=false do_dumpdiag=false do_cfgremove=false newinstance="" verifymac="" setnetdevname="" setwebconf="" setlicowner="" setlicense="" setdiagfile="" specificnetif="" lastowner="unknown" explicitopt=false while true ; do case "$1" in -a|--auto) automode=true; shift ;; --netif) explicitopt=true specificnetif="$2" shift 2 ;; -k|--kernel) explicitopt=true; do_cfgkernel=true; shift ;; -m|--modalias) explicitopt=true; do_cfgmods=true; shift ;; --newinstance) explicitopt=true do_cfgnewinstance=true if [ -n "$2" ]; then newinstance="$2" fi shift 2 ;; --verifymac) explicitopt=true do_cfgverifymac=true if [ -n "$2" ]; then verifymac="$2" fi shift 2 ;; -l|--license) explicitopt=true do_cfglicense=true if [ -n "$2" ]; then setlicense="$2" fi shift 2 ;; --netdevname) explicitopt=true do_cfgnetdevname=true if [ -n "$2" ]; then setnetdevname="$2" fi shift 2 ;; --webconf) explicitopt=true do_cfgwebconf=true if [ -n "$2" ]; then setwebconf="$2" fi shift 2 ;; -i|--info) explicitopt=true; do_infocfg=true; shift ;; -d|--dumpdiag) explicitopt=true do_dumpdiag=true setdiagfile="$2" shift 2 ;; -N|--noprobe) explicitopt=true do_dumpdiag=true noprobe=true shift ;; -r|--remove) explicitopt=true; do_cfgremove=true; shift ;; -h|--help) show_usage_and_exit; shift ;; -V|--version) echo "${dldrversion}"; exit 0;; --) shift ; break ;; *) echo "Internal error!" ; exit 1 ;; esac done # Accept --license <name> as equivalent to --license=<name> if ${do_cfglicense} && [ $# -ge 1 -a -z "${setlicense}" ]; then setlicense="$1" shift fi # Accept --netdevname <name> as equivalent to --netdevname=<name> if ${do_cfgnetdevname} && [ $# -ge 1 -a -z "${setnetdevname}" ]; then setnetdevname="$1" shift fi # Accept --webconf <addr:port> as equivalent to --webconf=<addr:port> if ${do_cfgwebconf} && [ $# -ge 1 -a -z "${setwebconf}" ]; then setwebconf="$1" shift fi # Accept --dumpdiag <file> as equivalent to --dumpdiag=<file> if ${do_dumpdiag} && [ $# -ge 1 -a -z "${setdiagfile}" ]; then setdiagfile="$1" shift fi procdrvdir="/proc/driver/driverloader" if [ $# -ne 0 ]; then echo 1>&2 "$0: extraneous arguments: $*" show_usage_and_exit fi # If nothing explicitely specified, configure everything if ! ${explicitopt}; then do_cfgkernel=true do_cfgmods=true # if ! ${isfreeversion}; then do_cfglicense=true # fi do_infocfg=true fi if ! ${do_cfgremove} && ! ${do_cfgnewinstance} && ! ${do_cfgverifymac}; then show_intro fi if ${do_cfgremove}; then # modulesconf must be modified before remove_kernel_modules (depmod) unconfigure_mods || exit $? remove_kernel_modules || exit $? dldrstop DLDRHELPERACTION=stop /usr/lib/driverloader/webconfd rm -f ${dldrcnfdir}/PCI*.conf rm -f ${dldrcnfdir}/*:* rm -f ${dldrcnfdir}/.perlmodsok #rm -f ${dldrvardir}/* fi if ${do_cfgkernel}; then configure_kernel || exit $? fi rereadparms=true if ${do_cfgmods} || ${do_cfglicense} || ${do_cfgnetdevname}; then if ! read_parms; then show_finish_info true exit 0 fi fi if ${do_cfgmods}; then configure_mods || exit $? fi if ${do_cfglicense}; then netif=0; while [ ${netif} -lt ${numnetifs} ]; do configure_license res=$? if [ ${res} -ne 0 ] && ${explicitopt}; then exit ${res} fi netif=`expr ${netif} + 1` done do_infocfg=true fi if ${do_cfgwebconf}; then configure_webconf res=$? if [ ${res} -ne 0 ] && ${explicitopt}; then exit ${res} fi fi if ${do_cfgnetdevname}; then netif=0; while [ ${netif} -lt ${numnetifs} ]; do configure_netdevname res=$? if [ ${res} -ne 0 ] && ${explicitopt}; then exit ${res} fi netif=`expr ${netif} + 1` done do_infocfg=true fi if ${do_cfgverifymac}; then if [ -h "${dldrcnfdir}/${newinstance}" ]; then newinstlink="`ls -l \"${dldrcnfdir}/${newinstance}\" | sed 's/.*-> //'`" elif [ -f "${dldrcnfdir}/${newinstance}" ]; then # initial configuration mv "${dldrcnfdir}/${newinstance}" "${dldrcnfdir}/${verifymac}" || exit $? ln -s "${verifymac}" "${dldrcnfdir}/${newinstance}" exit $? else newinstlink="" fi if [ "${verifymac}" = "${newinstlink}" ]; then exit 0 fi rm -f "${dldrcnfdir}/${newinstance}" || exit $? ln -s "${verifymac}" "${dldrcnfdir}/${newinstance}" exit 123 elif ${do_cfgnewinstance}; then for f in "${dldrvardir}"/*.inf; do if [ ! -f "${f}" ]; then continue fi dldrinfparse "$f" "${newinstance}" > "${dldrcnfdir}/${newinstance}".tmp if [ $? = 0 -a -s "${dldrcnfdir}/${newinstance}".tmp ]; then if [ -s "${dldrnvmdir}/netdevnameformat" ]; then read netdevnameformat < ${dldrnvmdir}/netdevnameformat echo "DriverLoaderNetDevName=\"${netdevnameformat}\"" >> "${dldrcnfdir}/${newinstance}".tmp else case "${OSDISTNAME}${OSDISTVERS}" in SuSE9*) echo "DriverLoaderNetDevName=\"wlan%d\"" >> "${dldrcnfdir}/${newinstance}".tmp ;; *) ;; esac fi mv "${dldrcnfdir}/${newinstance}".tmp "${dldrcnfdir}/${newinstance}" res=$? if [ ${res} -ne 0 ]; then rm -f "${dldrcnfdir}/${newinstance}".tmp exit ${res} fi break fi rm -f "${dldrcnfdir}/${newinstance}".tmp done fi if ${do_infocfg}; then if ${rereadparms}; then if ! read_parms; then show_finish_info true exit 0 fi fi case "${parm_webconf}" in ?*:?*) echo "" echo "Web configurator: listening on ${parm_webconf}" ;; *) echo "" echo "Web configurator: disabled" ;; esac echo "" echo "Current parameters: (\"dldrconfig --info\")" netif=0; while [ ${netif} -lt ${numnetifs} ]; do show_netif_parms netif=`expr ${netif} + 1` done if ${sawinvalidlicenses}; then if ${isfreeversion}; then needfullversion else show_finish_info false echo "" case "${parm_webconf}" in ?*:?*) echo "To enable the driver, enter your license information via the web configurator at" show_webconf_url echo "or with \"dldrconfig --license\"." ;; *) echo "To enable the driver, enter your license information with \"dldrconfig --license\"." ;; esac echo "" echo "License owner and key data must EXACTLY match the information respectively" echo "provided to and by Linuxant. Otherwise, license status will not be \"OK\"!" fi fi fi if ${do_dumpdiag}; then if [ -n "${setdiagfile}" ]; then dldrdiagfile="${setdiagfile}" fi dump_diagnostics || exit $? fi